﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PhotoAdd.aspx.cs" Inherits="Omabar.CMS.CMS.PhotoAdd" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" type="text/css" href="../CSS/bootstrap_min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/bootstrap_responsive_min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/Style.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/todc_bootstrap.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/Themes.css" media="all" />
    <link rel="stylesheet" type="text/css" href="../CSS/inside.css" media="all" />
    <script type="text/javascript" src="../JavaScript/jquery.1.8.3.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery.cookie.js"></script>
    <script type="text/javascript" src="../JavaScript/bootstrap.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_validate_min.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_validate_methods.js"></script>
    <script type="text/javascript" src="../JavaScript/jquery_form_min.js"></script>
    <script type="text/javascript" src="../JavaScript/inside.js"></script>
    <link href="../KindEditor/Themes/Default/default.css" rel="stylesheet" />
    <script src="../KindEditor/kindeditor-min.js"></script>
    <script src="../KindEditor/lang/zh_CN.js"></script>
    <script src="../KindEditor/kindeditor.config-upfile.js"></script>
    <title>上传图片</title>
    <!--[if IE 7]><link href="../CSS/font_awesome_ie7.css" rel="stylesheet" /><![endif]-->
    <!--[if lte IE 8]><script src="../JavaScript/excanvas_min.js"></script><![endif]-->
    <!--[if lte IE 9]><script src="../JavaScript/watermark.js"></script><![endif]-->

    <style type="text/css">
        option {
            padding: 5px;
        }
    </style>
</head>
<body>
    <div id="main">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="box">
                        <div class="box-title">
                            <div class="span12">
                                <h3><i class="icon-cog"></i>添加图片（每次最多上传5张，可多次上传）</h3>
                            </div>
                        </div>
                        <form action="../Handler/PhotoAdd.ashx" method="post" class="form-horizontal form-validate">
                            <div class="box-content">
                                <table>
                                    <tr>
                                        <td>
                                            <div>
                                                <label for="imgName_0">图片名称：</label>
                                                <div>
                                                    <input type="text" name="imgName_0"  class="input-medium" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <label for="imgDes_0">图片描述：</label>
                                                <div>
                                                    <input type="text" name="imgDes_0"  class="input-large" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <label for="imgHot_0">图片热度(0-100)：</label>
                                                <div>
                                                    <input type="text" name="imgHot_0"  data-rule-number="true" data-rule-max="100"  class="input-mini"  value="0" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <label for="imgCover_0">设置封面：</label>
                                                <div style="width:30px;height:30px;">
                                                    <input type="checkbox" name="imgCover_0" value="1"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <img type="img" src="../Images/cover_default.jpg" style="max-height: 50px;" />
                                                    <input type="hidden" name="picurl_0" value="../Images/cover_default.jpg" class="input-medium" />
                                                    <a class="btn insertimage">选择图片</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgName_1"  class="input-medium" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgDes_1"  class="input-large" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgHot_1"  data-rule-number="true" data-rule-max="100"  class="input-mini" value="0" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div style="width:30px;height:30px;">
                                                    <input type="checkbox" name="imgCover_1" value="1"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <img type="img" src="../Images/cover_default.jpg" style="max-height: 50px;" />
                                                    <input type="hidden" name="picurl_1" value="../Images/cover_default.jpg" class="input-medium" />
                                                    <a class="btn insertimage">选择图片</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgName_2"  class="input-medium" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgDes_2"  class="input-large" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgHot_2"  data-rule-number="true" data-rule-max="100"  class="input-mini" value="0"  />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div style="width:30px;height:30px;">
                                                    <input type="checkbox" name="imgCover_2" value="1"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <img type="img" src="../Images/cover_default.jpg" style="max-height: 50px;" />
                                                    <input type="hidden" name="picurl_2" value="../Images/cover_default.jpg" class="input-medium" />
                                                    <a class="btn insertimage">选择图片</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgName_3"  class="input-medium" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgDes_3"  class="input-large" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgHot_3"  data-rule-number="true" data-rule-max="100"  class="input-mini"  value="0" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div style="width:30px;height:30px;">
                                                    <input type="checkbox" name="imgCover_3" value="1"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <img type="img" src="../Images/cover_default.jpg" style="max-height: 50px;" />
                                                    <input type="hidden" name="picurl_3" value="../Images/cover_default.jpg" class="input-medium" />
                                                    <a class="btn insertimage">选择图片</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgName_4"  class="input-medium" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgDes_4"  class="input-large" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <input type="text" name="imgHot_4"  data-rule-number="true" data-rule-max="100"  class="input-mini"  value="0" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div style="width:30px;height:30px;">
                                                    <input type="checkbox" name="imgCover_4" value="1"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <div>
                                                    <img type="img" src="../Images/cover_default.jpg" style="max-height: 50px;" />
                                                    <input type="hidden" name="picurl_4" value="../Images/cover_default.jpg" class="input-medium" />
                                                    <a class="btn insertimage">选择图片</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <div id="res_block">
                                    <div class="form-actions">
                                        <button type="submit" class="btn btn-primary">保存</button>
                                        <button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    KindEditor.ready(function (K) {
        var editor = K.editor({
            themeType: 'simple',
            allowFileManager: true
        });
        $('a.insertimage').live('click', function (e) {
            editor.loadPlugin('smimage', function () {
                editor.plugin.imageDialog({
                    imageUrl: $(e.target).prev().val(),
                    clickFn: function (url, title, width, height, border, align) {
                        $(e.target).prev().val(url);
                        if ('img' == $(e.target).prev().prev().attr('type')) {
                            $(e.target).prev().hide();
                            $(e.target).prev().prev().attr('src', url);
                            $(e.target).prev().prev().show();
                        }
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>
</html>